home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Misc / Crossword / Source / Inspector.m < prev    next >
Text File  |  1992-10-12  |  1KB  |  76 lines

  1. /*
  2.  
  3. File Inspector.m
  4.  
  5. The inspector allows the user to adjust the type of search as well as the various hueristics used to control it.
  6.  
  7. */
  8.  
  9. #import <appkit/appkit.h>
  10. #import <stdio.h>
  11.  
  12. #import "Inspector.h"
  13. #import "StopWatch.h"
  14.  
  15.  
  16. /* ————————————————————————————————————————————————————————————————————————————  */
  17.  
  18.  
  19. @implementation Inspector
  20.  
  21.  
  22. - (int) getStateType            {    return [stateType  selectedTag];              }
  23. - (BOOL) getOption: (int) i        {    return [[options findCellWithTag: i] state];  }
  24. - getWatch                        {    return stopWatch;                              }
  25. - getTimeCell                    {    return time;                                  }
  26.  
  27.  
  28. /* ————————————————————————————————————————————————————————————————————————————  */
  29.  
  30.  
  31. - init
  32. {
  33.     [super  init];
  34.     
  35.     color[0] = NX_COLORWHITE;
  36.     color[1] = NX_COLORBLACK;
  37.     color[2] = NX_COLORBLUE;
  38.     color[3] = NX_COLORBLACK;
  39.     color[4] = NX_COLORYELLOW;
  40.     color[5] = NX_COLORRED;
  41.     
  42.     return self;
  43. }
  44.  
  45.  
  46. /* ————————————————————————————————————————————————————————————————————————————  */
  47.  
  48.  
  49. - (squareColor) getColor: (int) i
  50. {
  51.     squareColor        theColor;
  52.     
  53.     theColor.background = color[i * 2];
  54.     theColor.text = color[i * 2 + 1];
  55.     
  56.     return theColor;
  57. }
  58.  
  59.  
  60. - takeColor: sender
  61. {
  62.     color[[sender  tag]] = [sender  color];
  63.     return self;
  64. }
  65.  
  66.  
  67. - showTime
  68. {
  69.     [time  setFloatingPointFormat: NO  left: 6  right: 2];
  70.     [time  setFloatValue: [stopWatch  getTime]];
  71.     
  72.     return self;
  73. }
  74.  
  75.  
  76. @end